<?php
/************************************************************************************************
 * Copyright (c) 2004-2009, codesign
 * 
 * All rights reserved.
 * 
 * LICENCE CC/BSD
 * You are free:
 * 
 * to Share & to copy, distribute and transmit the work
 * to Remix & to adapt the work
 * 
 * Under the following conditions:
 * 
 * Attribution. You must attribute the work in the manner specified by the author or 
 * licensor (but not in any way that suggests that they endorse you or your use of the work).
 * Share Alike. If you alter, transform, or build upon this work, you may distribute 
 * the resulting work only under the same, similar or a compatible license.
 * For any reuse or distribution, you must make clear to others the license terms of 
 * this work. The best way to do this is with a link to this web page.
 * Any of the above conditions can be waived if you get permission from the copyright holder.
 * Nothing in this license impairs or restricts the author's moral rights.
 * 
 * LICENCE BSD
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, 
 * this list of conditions and the following disclaimer in the documentation 
 * and/or other materials provided with the distribution.
 * Neither the name of "codesign" nor the names of its contributors may be used 
 * to endorse or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ************************************************************************************************/
date_default_timezone_set ( 'Europe/Paris' );
setlocale(LC_TIME, "fr", "FR", "fr_FR", "fr_FR.ISO8859-1");
include_once( '_prerun' );
include_once( 'private/lib/common.php5' );
include_once LIB_ROOT . 'common.php5';
define( 'PAGE_ROOT', FILE_ROOT . 'site' );
/////////////////////////////////////////////////////////////////////////////////////
if(isset($old_error_handler)) set_error_handler ( $old_error_handler );

/////////////////////////////////////////////////////////////////////////////////////
function scanDirForTests( $dir )
	{
	$ret = array();
   if( is_dir( $dir ) )
      {
      $sourcedir = opendir( $dir );
      while( false !== ( $file = readdir( $sourcedir ) ) )
         {
         $source_file = $dir . '/' . $file;
         $source_file = str_replace( '//', '/', $source_file );
         if( is_dir( $source_file ) )
            {
            if( $file == '.' || $file == '..' ) continue;
            scanDirForTests( $source_file );
            }
         else
         if( eregi( '(.*)\.test\.php5', $file ) )
         	{
            $ret[] = $source_file;
            //echo "<p>add {$source_file} to the tester</p>\n";
         	}
         }
      closedir( $sourcedir );
      }
     return $ret;
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="Robots" content="none" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Language" content="fr" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title></title>
<script type="text/javascript" src="/scripts/jquery.min.js" charset="iso-8859-1"></script>
<script type="text/javascript" language="javascript" charset="iso-8859-1">
// <![CDATA[
$(document).ready(function() {
});
// ]]>
</script>
<style type="text/css">
/*<![CDATA[*/
@import url("/css/common.css");
/*]]>*/
</style>
<!--[if IE]>
<style type="text/css">
@import url("/css/ie7.css");
</style>
<![endif]-->
<!--[if lte IE 6]>
<style type="text/css">
@import url("/css/ie6.php");
</style>
<![endif]-->
</head>

<body>
<?php
/////////////////////////////////////////////////////////////////////////////////////
require_once( OTHERLIB_ROOT . '/simpletest/autorun.php');
require_once( OTHERLIB_ROOT . '/simpletest/browser.php');
require_once( OTHERLIB_ROOT . '/simpletest/web_tester.php');

class AllTests extends TestSuite
	{
	function AllTests()
		{
		$this->TestSuite( 'Tests for ' . SITE_NAME );
#		$tests_to_run_1 = scanDirForTests( FILE_ROOT . 'private/lib' );
#		$tests_to_run_2 = scanDirForTests( FILE_ROOT . 'private/app' );
#		$tests_to_run_3 = scanDirForTests( FILE_ROOT . 'site' );
		$tests_to_run_1 = scanDirForTests( FILE_ROOT );
		$tests_to_run = array_merge( $tests_to_run_1 );
		if( count( $tests_to_run ) > 0 )
			{
			foreach( $tests_to_run as $test_file )
				{
				$this->addFile( $test_file );
				}
			}
		}
	}

?>
</body>
</html>
